package tacos.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.converter.Converter;
import tacos.domain.Ingredient.Type;

@Configuration
public class StringToTypeConverter implements Converter<String, Type> {
    @Override
    public Type convert(String s) {
        String value = s.trim();
        if ("".equals(value)) {
            return null;
        }
        System.out.println("执行了 Converter");

        return Type.valueOf(s);
    }
}
